package com.shanxia.im.sdk.client.constant;

/**
 * 常量
 */
public interface CIMConstant {

	long RECONNECT_INTERVAL_TIME = 30 * 1000;
	/*
	 * 	消息头长度为4个字节，第三，第四字节 转换int后为消息长度
	 */
	int DATA_HEADER_LENGTH = 4;


	interface ConfigKey {
		String CLIENT_VERSION = "client.version";
		String CLIENT_ACCOUNT = "client.account";
		String CLIENT_DEVICE_ID = "client.deviceId";
	}

	interface ProtobufType {
		byte C_H_RS = 0;
		byte S_H_RQ = 1;
		byte MESSAGE = 2;
		byte SENT_BODY = 3;
		byte REPLY_BODY = 4;
	}

	interface RequestKey {

		String CLIENT_BIND = "client_bind";

	}

	interface MessageAction {
		/*
		被其他设备登录挤下线消息
		 */
		String ACTION_999 = "999";
	}

	interface IntentAction {

		/*
		 消息广播action
		 */
		String ACTION_MESSAGE_RECEIVED = "com.shanxia.im.ACTION_MESSAGE_RECEIVED";

		/*
		 发送sendBody成功广播
		 */
		String ACTION_SEND_FINISHED = "com.shanxia.im.ACTION_SEND_FINISHED";

		/*
		 链接意外关闭广播
		 */
		String ACTION_CONNECTION_CLOSED = "com.shanxia.im.ACTION_CONNECTION_CLOSED";

		/*
		 链接失败广播
		 */
		String ACTION_CONNECT_FAILED = "com.shanxia.im.ACTION_CONNECT_FAILED";

		/*
		 链接成功广播
		 */
		String ACTION_CONNECT_FINISHED = "com.shanxia.im.ACTION_CONNECT_FINISHED";

		/*
		 发送sendBody成功后获得replyBody回应广播
		 */
		String ACTION_REPLY_RECEIVED = "com.shanxia.im.ACTION_REPLY_RECEIVED";

		/*
		 重试连接
		 */
		String ACTION_CONNECTION_RECOVERY = "com.shanxia.im.CONNECTION_RECOVERY";
	}

}
